import greenfoot.*;

/**
 * This class defines a crab. Crabs live on the beach.
 */
public class Crab extends Actor
{
    public void act()
    {
        //move(1);
        //turnAtEdge();
        keyControl();
    }
    
    /*public void turnAtEdge() {
        if(isAtEdge()) {
           turn(30);
        }
    }*/
    
    public void keyControl() {
        if(Greenfoot.isKeyDown("left")) {
           turn(15);
        }
        if(Greenfoot.isKeyDown("right")) {
           turn(-15);
        }
        if(Greenfoot.isKeyDown("up")) {
           move(3);
        }
        if(Greenfoot.isKeyDown("down")) {
           move(-3);
        }
    }
}


